package com.youlu.campus.service.activity.impl;

import com.youlu.campus.entity.ActivitySimulationData;
import com.youlu.campus.service.activity.ActivitySimulationDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class ActivitySimulationDataServiceImpl implements ActivitySimulationDataService {
    @Autowired
    private MongoTemplate mongoTemplate;

    @Override
    public ActivitySimulationData findByActivityId(String activityId) {
        Query query = new Query();
        query.addCriteria(Criteria.where("activityId").is(activityId));
        return mongoTemplate.findOne(query, ActivitySimulationData.class);
    }
}
